<!DOCTYPE html><html><head>
      <title>fcgx_process</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      
      <link rel="stylesheet" href="file:////Users/wangyong/.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.6.2/node_modules/@shd101wyy/mume/dependencies/katex/katex.min.css">
      
      
      
      
      
      
      
      
      
      <style>
      /**
 * prism.js Github theme based on GitHub's theme.
 * @author Sam Clarke
 */
code[class*="language-"],
pre[class*="language-"] {
  color: #333;
  background: none;
  font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.4;

  -moz-tab-size: 8;
  -o-tab-size: 8;
  tab-size: 8;

  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

/* Code blocks */
pre[class*="language-"] {
  padding: .8em;
  overflow: auto;
  /* border: 1px solid #ddd; */
  border-radius: 3px;
  /* background: #fff; */
  background: #f5f5f5;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
  padding: .1em;
  border-radius: .3em;
  white-space: normal;
  background: #f5f5f5;
}

.token.comment,
.token.blockquote {
  color: #969896;
}

.token.cdata {
  color: #183691;
}

.token.doctype,
.token.punctuation,
.token.variable,
.token.macro.property {
  color: #333;
}

.token.operator,
.token.important,
.token.keyword,
.token.rule,
.token.builtin {
  color: #a71d5d;
}

.token.string,
.token.url,
.token.regex,
.token.attr-value {
  color: #183691;
}

.token.property,
.token.number,
.token.boolean,
.token.entity,
.token.atrule,
.token.constant,
.token.symbol,
.token.command,
.token.code {
  color: #0086b3;
}

.token.tag,
.token.selector,
.token.prolog {
  color: #63a35c;
}

.token.function,
.token.namespace,
.token.pseudo-element,
.token.class,
.token.class-name,
.token.pseudo-class,
.token.id,
.token.url-reference .token.variable,
.token.attr-name {
  color: #795da3;
}

.token.entity {
  cursor: help;
}

.token.title,
.token.title .token.punctuation {
  font-weight: bold;
  color: #1d3e81;
}

.token.list {
  color: #ed6a43;
}

.token.inserted {
  background-color: #eaffea;
  color: #55a532;
}

.token.deleted {
  background-color: #ffecec;
  color: #bd2c00;
}

.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}


/* JSON */
.language-json .token.property {
  color: #183691;
}

.language-markup .token.tag .token.punctuation {
  color: #333;
}

/* CSS */
code.language-css,
.language-css .token.function {
  color: #0086b3;
}

/* YAML */
.language-yaml .token.atrule {
  color: #63a35c;
}

code.language-yaml {
  color: #183691;
}

/* Ruby */
.language-ruby .token.function {
  color: #333;
}

/* Markdown */
.language-markdown .token.url {
  color: #795da3;
}

/* Makefile */
.language-makefile .token.symbol {
  color: #795da3;
}

.language-makefile .token.variable {
  color: #183691;
}

.language-makefile .token.builtin {
  color: #0086b3;
}

/* Bash */
.language-bash .token.keyword {
  color: #0086b3;
}

/* highlight */
pre[data-line] {
  position: relative;
  padding: 1em 0 1em 3em;
}
pre[data-line] .line-highlight-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  background-color: transparent;
  display: block;
  width: 100%;
}

pre[data-line] .line-highlight {
  position: absolute;
  left: 0;
  right: 0;
  padding: inherit 0;
  margin-top: 1em;
  background: hsla(24, 20%, 50%,.08);
  background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
  pointer-events: none;
  line-height: inherit;
  white-space: pre;
}

pre[data-line] .line-highlight:before, 
pre[data-line] .line-highlight[data-end]:after {
  content: attr(data-start);
  position: absolute;
  top: .4em;
  left: .6em;
  min-width: 1em;
  padding: 0 .5em;
  background-color: hsla(24, 20%, 50%,.4);
  color: hsl(24, 20%, 95%);
  font: bold 65%/1.5 sans-serif;
  text-align: center;
  vertical-align: .3em;
  border-radius: 999px;
  text-shadow: none;
  box-shadow: 0 1px white;
}

pre[data-line] .line-highlight[data-end]:after {
  content: attr(data-end);
  top: auto;
  bottom: .4em;
}html body{font-family:"Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff;overflow:initial;box-sizing:border-box;word-wrap:break-word}html body>:first-child{margin-top:0}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{line-height:1.2;margin-top:1em;margin-bottom:16px;color:#000}html body h1{font-size:2.25em;font-weight:300;padding-bottom:.3em}html body h2{font-size:1.75em;font-weight:400;padding-bottom:.3em}html body h3{font-size:1.5em;font-weight:500}html body h4{font-size:1.25em;font-weight:600}html body h5{font-size:1.1em;font-weight:600}html body h6{font-size:1em;font-weight:600}html body h1,html body h2,html body h3,html body h4,html body h5{font-weight:600}html body h5{font-size:1em}html body h6{color:#5c5c5c}html body strong{color:#000}html body del{color:#5c5c5c}html body a:not([href]){color:inherit;text-decoration:none}html body a{color:#08c;text-decoration:none}html body a:hover{color:#00a3f5;text-decoration:none}html body img{max-width:100%}html body>p{margin-top:0;margin-bottom:16px;word-wrap:break-word}html body>ul,html body>ol{margin-bottom:16px}html body ul,html body ol{padding-left:2em}html body ul.no-list,html body ol.no-list{padding:0;list-style-type:none}html body ul ul,html body ul ol,html body ol ol,html body ol ul{margin-top:0;margin-bottom:0}html body li{margin-bottom:0}html body li.task-list-item{list-style:none}html body li>p{margin-top:0;margin-bottom:0}html body .task-list-item-checkbox{margin:0 .2em .25em -1.8em;vertical-align:middle}html body .task-list-item-checkbox:hover{cursor:pointer}html body blockquote{margin:16px 0;font-size:inherit;padding:0 15px;color:#5c5c5c;background-color:#f0f0f0;border-left:4px solid #d6d6d6}html body blockquote>:first-child{margin-top:0}html body blockquote>:last-child{margin-bottom:0}html body hr{height:4px;margin:32px 0;background-color:#d6d6d6;border:0 none}html body table{margin:10px 0 15px 0;border-collapse:collapse;border-spacing:0;display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}html body table th{font-weight:bold;color:#000}html body table td,html body table th{border:1px solid #d6d6d6;padding:6px 13px}html body dl{padding:0}html body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:bold}html body dl dd{padding:0 16px;margin-bottom:16px}html body code{font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:.85em !important;color:#000;background-color:#f0f0f0;border-radius:3px;padding:.2em 0}html body code::before,html body code::after{letter-spacing:-0.2em;content:"\00a0"}html body pre>code{padding:0;margin:0;font-size:.85em !important;word-break:normal;white-space:pre;background:transparent;border:0}html body .highlight{margin-bottom:16px}html body .highlight pre,html body pre{padding:1em;overflow:auto;font-size:.85em !important;line-height:1.45;border:#d6d6d6;border-radius:3px}html body .highlight pre{margin-bottom:0;word-break:normal}html body pre code,html body pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}html body pre code:before,html body pre tt:before,html body pre code:after,html body pre tt:after{content:normal}html body p,html body blockquote,html body ul,html body ol,html body dl,html body pre{margin-top:0;margin-bottom:16px}html body kbd{color:#000;border:1px solid #d6d6d6;border-bottom:2px solid #c7c7c7;padding:2px 4px;background-color:#f0f0f0;border-radius:3px}@media print{html body{background-color:#fff}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{color:#000;page-break-after:avoid}html body blockquote{color:#5c5c5c}html body pre{page-break-inside:avoid}html body table{display:table}html body img{display:block;max-width:100%;max-height:100%}html body pre,html body code{word-wrap:break-word;white-space:pre}}.markdown-preview{width:100%;height:100%;box-sizing:border-box}.markdown-preview .pagebreak,.markdown-preview .newpage{page-break-before:always}.markdown-preview pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}.markdown-preview pre.line-numbers>code{position:relative}.markdown-preview pre.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:1em;font-size:100%;left:0;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown-preview pre.line-numbers .line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.markdown-preview pre.line-numbers .line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}.markdown-preview .mathjax-exps .MathJax_Display{text-align:center !important}.markdown-preview:not([for="preview"]) .code-chunk .btn-group{display:none}.markdown-preview:not([for="preview"]) .code-chunk .status{display:none}.markdown-preview:not([for="preview"]) .code-chunk .output-div{margin-bottom:16px}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba(150,150,150,0.66);background-clip:content-box}html body[for="html-export"]:not([data-presentation-mode]){position:relative;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:auto}html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{position:relative;top:0}@media screen and (min-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em calc(50% - 457px + 2em)}}@media screen and (max-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{font-size:14px !important;padding:1em}}@media print{html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{display:none}}html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{position:fixed;bottom:8px;left:8px;font-size:28px;cursor:pointer;color:inherit;z-index:99;width:32px;text-align:center;opacity:.4}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] #sidebar-toc-btn{opacity:1}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc{position:fixed;top:0;left:0;width:300px;height:100%;padding:32px 0 48px 0;font-size:14px;box-shadow:0 0 4px rgba(150,150,150,0.33);box-sizing:border-box;overflow:auto;background-color:inherit}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar{width:8px}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba(150,150,150,0.66);background-clip:content-box}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc a{text-decoration:none}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul{padding:0 1.6em;margin-top:.8em}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc li{margin-bottom:.8em}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul{list-style-type:none}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{left:300px;width:calc(100% -  300px);padding:2em calc(50% - 457px -  150px);margin:0;box-sizing:border-box}@media screen and (max-width:1274px){html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{width:100%}}html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .markdown-preview{left:50%;transform:translateX(-50%)}html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .md-sidebar-toc{display:none}
/* Please visit the URL below for more information: */
/*   https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */

      </style>
    </head>
    <body for="html-export">
      <div class="mume markdown-preview  ">
      <p>overload&#x76F8;&#x5173;&#x5206;&#x6790;</p>
<p>rgw_main.cc<br>
new RGWFCGXFrontend<br>
RGWFCGXFrontend::init -&gt; new RGWFCGXProcess</p>
<p>RGWProcess<br>
ThreadPool m_tp; &#x591A;&#x4E2A;,&#x7EBF;&#x7A0B;&#x540D;&#x5B57;tp_rgw_process<br>
RGWWQ req_wq; &#x5355;&#x4E2A; &#xFF08;&#x4F18;&#x5316;&#x53EF;&#x4EE5;&#x8003;&#x8651;sharded_wq&#xFF09;<br>
deque&lt;UserQosRequest*&gt; m_req_queue;</p>
<p>RGWFCGXProcess:RGWProcess  (rgw_thread_pool_size, rgw_thread_max_ops)<br>
max_connections = rgw_thread_pool_size * rgw_thread_max_ops<br>
run() [rgw_frontend&#x7EBF;&#x7A0B;]&#x3010;&#x5355;&#x7EBF;&#x7A0B;&#x4E0D;&#x53EF;&#x914D;&#x7F6E;&#x3011;<br>
rgw_fcgi_socket_backlog =1000,<br>
rgw_socket_path&#x4E0D;&#x4E3A;&#x7A7A;&#xFF0C;&#x5219;&#x8D70;unixsocket&#xFF1B;&#x5426;&#x5219;&#x8BFB;&#x53D6;&#x96C6;&#x7FA4;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x53C2;&#x6570;rgw_port/rgw_host,&#x8D70;tcp&#x3002;(&#x8FD9;&#x4E2A;port&#x662F;&#x6307;rgw&#x6536;nginx&#x53D1;&#x51FA;&#x53BB;&#x7684;&#x7AEF;&#x53E3;)<br>
QueueRing&lt;FCGX_Request&gt;* qr (max_connections)<br>
FCGX_Accept_r&#x4E00;&#x4E2A;&#x8BF7;&#x6C42;&#xFF0C;&#x4E22;&#x5230;req_wq&#x91CC;&#x9762;&#x5904;&#x7406;&#x3002; &#xFF08;fastcgi&#xFF09;<br>
/usr/include/fcgiapp.h fcgi-devel<br>
links:<a href="https://github.com/FastCGI-Archives/fcgi2/blob/master/libfcgi/fcgiapp.c">https://github.com/FastCGI-Archives/fcgi2/blob/master/libfcgi/fcgiapp.c</a></p>
<p>tp_rgw_process<br>
req_wq._process<br>
process_request&#x540C;&#x6B65;&#x5B8C;&#x6210;&#x6240;&#x6709;&#x5904;&#x7406;&#x3002; &#x3010;&#x6536;socket&#x6570;&#x636E;&#xFF0C;&#x5199;&#x5BF9;&#x8C61;&#x7B49;&#x3011;<br>
&#x3010;&#x91CC;&#x9762;&#x53D1;&#x7ED9;osd&#x662F;aio&#x63A5;&#x53E3;&#xFF0C;&#x4F46;&#x662F;&#x9664;&#x4E86;&#x90E8;&#x5206;&#x573A;&#x666F;&#xFF0C;&#x5927;&#x90E8;&#x5206;&#x8FD9;&#x4E2A;&#x5BF9;&#x8C61;&#x90FD;&#x53EF;&#x4EE5;&#x5E76;&#x884C;&#xFF0C;&#x4F46;&#x662F;&#x6700;&#x7EC8;&#x80AF;&#x5B9A;&#x8981;&#x5728;&#x8FD9;&#x4E2A;&#x7EBF;&#x7A0B;&#x5904;&#x7406;&#x5B8C;&#x3011;<br>
&#x3010;put_data_and_throttle&#x63A5;&#x53E3;&#xFF0C;&#x672A;&#x6765;&#x9700;&#x8981;&#x518D;&#x4ED4;&#x7EC6;&#x5206;&#x6790;&#x3011;<br>
&#xFF08;put_lat&#x548C;get_lat&#x53EF;&#x4EE5;&#x770B;&#x51FA;&#x5F53;&#x4E0B;&#x662F;&#x5426;&#x5904;&#x7406;&#x7684;&#x5F88;&#x6162;&#xFF09;</p>
<p>RGWWQ req_wq;<br>
T  UserQosRequest<br>
_enqueue  dout(20) &quot;enqueued request&quot;<br>
_dequeue  dout(20) &quot;dequeued request&quot;<br>
_process<br>
rgw_op_thread_suicide_timeout / rgw_op_thread_timeout</p>
<p>l_rgw_qlen     m_req_queue.size()  &#x961F;&#x5217;&#x4E2D;&#x672A;&#x5904;&#x7406;&#x7684;<br>
l_rgw_qactive  workerqueue process  status  (rgw_thread_pool_size=100) &#x6B63;&#x5728;&#x5904;&#x7406;&#x4E2D;&#x7684;&#x3002;</p>
<p>&#x8865;rgw&#x57FA;&#x672C;&#x4E1A;&#x52A1;&#x6D41;&#x6846;&#x67B6;&#x56FE;</p>
<p><!--?xml version="1.0" encoding="UTF-8" standalone="no"?--><svg xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" contentscripttype="application/ecmascript" contentstyletype="text/css" height="1085px" preserveAspectRatio="none" style="width:803px;height:1085px;background:#FFFFFF;" version="1.1" viewBox="0 0 803 1085" width="803px" zoomAndPan="magnify"><defs><filter height="300%" id="f1ohd75zkk3k4h" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><!--MD5=[5e861b9fdb9b17ed7236d4a5496d9606]
entity NginxProcess1--><rect fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" height="46.4883" style="stroke:#A80036;stroke-width:1.5;" width="142" x="7" y="11"/><rect fill="#FEFECE" height="10" style="stroke:#A80036;stroke-width:1.5;" width="15" x="129" y="16"/><rect fill="#FEFECE" height="2" style="stroke:#A80036;stroke-width:1.5;" width="4" x="127" y="18"/><rect fill="#FEFECE" height="2" style="stroke:#A80036;stroke-width:1.5;" width="4" x="127" y="22"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="102" x="22" y="44.5352">NginxProcess1</text><!--MD5=[3fa850b1faeae3c7329124a3a8bc23cf]
entity NginxProcess2--><rect fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" height="46.4883" style="stroke:#A80036;stroke-width:1.5;" width="142" x="184" y="11"/><rect fill="#FEFECE" height="10" style="stroke:#A80036;stroke-width:1.5;" width="15" x="306" y="16"/><rect fill="#FEFECE" height="2" style="stroke:#A80036;stroke-width:1.5;" width="4" x="304" y="18"/><rect fill="#FEFECE" height="2" style="stroke:#A80036;stroke-width:1.5;" width="4" x="304" y="22"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="102" x="199" y="44.5352">NginxProcess2</text><!--MD5=[dba71807a00328a884dc4fa63fe50466]
entity NginxProcessN--><rect fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" height="46.4883" style="stroke:#A80036;stroke-width:1.5;" width="143" x="361.5" y="11"/><rect fill="#FEFECE" height="10" style="stroke:#A80036;stroke-width:1.5;" width="15" x="484.5" y="16"/><rect fill="#FEFECE" height="2" style="stroke:#A80036;stroke-width:1.5;" width="4" x="482.5" y="18"/><rect fill="#FEFECE" height="2" style="stroke:#A80036;stroke-width:1.5;" width="4" x="482.5" y="22"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="103" x="376.5" y="44.5352">NginxProcessN</text><!--MD5=[375cfdbcdf19d084626d4630eaee9973]
entity fcgi--><rect fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" height="46.4883" style="stroke:#A80036;stroke-width:1.5;" width="65" x="222.5" y="258"/><rect fill="#FEFECE" height="10" style="stroke:#A80036;stroke-width:1.5;" width="15" x="267.5" y="263"/><rect fill="#FEFECE" height="2" style="stroke:#A80036;stroke-width:1.5;" width="4" x="265.5" y="265"/><rect fill="#FEFECE" height="2" style="stroke:#A80036;stroke-width:1.5;" width="4" x="265.5" y="269"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="25" x="237.5" y="291.5352">fcgi</text><!--MD5=[f2a86617c81af88a88cc162485ef38ed]
entity rgw_frontend_thread--><rect fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" height="46.4883" style="stroke:#A80036;stroke-width:1.5;" width="185" x="162.5" y="397"/><rect fill="#FEFECE" height="10" style="stroke:#A80036;stroke-width:1.5;" width="15" x="327.5" y="402"/><rect fill="#FEFECE" height="2" style="stroke:#A80036;stroke-width:1.5;" width="4" x="325.5" y="404"/><rect fill="#FEFECE" height="2" style="stroke:#A80036;stroke-width:1.5;" width="4" x="325.5" y="408"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="145" x="177.5" y="430.5352">rgw_frontend_thread</text><!--MD5=[c087d594b491d1e3c66751e7cfb55d7b]
entity TCP_UnixSocket1--><ellipse cx="81" cy="152" fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" rx="8" ry="8" style="stroke:#A80036;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="120" x="21" y="182.5352">TCP_UnixSocket1</text><!--MD5=[5ff682b1fdd4bb45fbe7defc846b91a0]
entity TCP_UnixSocket2--><ellipse cx="255" cy="152" fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" rx="8" ry="8" style="stroke:#A80036;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="120" x="195" y="182.5352">TCP_UnixSocket2</text><!--MD5=[1e29de2353939b2a04418e385930b4df]
entity TCP_UnixSocketN--><ellipse cx="433" cy="152" fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" rx="8" ry="8" style="stroke:#A80036;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="121" x="372.5" y="182.5352">TCP_UnixSocketN</text><path d="M540,6 L540,61.9316 A0,0 0 0 0 540,61.9316 L608.43,61.9316 L442.01,146.54 L616.43,61.9316 L794,61.9316 A0,0 0 0 0 794,61.9316 L794,16 L784,6 L540,6 A0,0 0 0 0 540,6 " fill="#FBFB77" filter="url(#f1ohd75zkk3k4h)" style="stroke:#A80036;stroke-width:1.0;"/><path d="M784,6 L784,16 L794,16 L784,6 " fill="#FBFB77" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="72" x="546" y="23.5684">default:TCP</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="129" x="546" y="38.8789">could be UnixSocket</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="233" x="546" y="54.1895">concurrent decided to cosbench jobs</text><!--MD5=[0f271fea04fd8950065e3ba9e1b0eff8]
entity req_wq--><ellipse cx="255" cy="549" fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" rx="8" ry="8" style="stroke:#A80036;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="50" x="230" y="579.5352">req_wq</text><!--MD5=[42e6896cdde256579bfd70819d52db4f]
entity tp_rgw_process_1--><ellipse cx="82" cy="689" fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" rx="8" ry="8" style="stroke:#A80036;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="123" x="20.5" y="719.5352">tp_rgw_process_1</text><!--MD5=[3f9d2f51e9e7f8d0b5ac47544b4b0b5e]
entity tp_rgw_process_2--><ellipse cx="255" cy="689" fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" rx="8" ry="8" style="stroke:#A80036;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="123" x="193.5" y="719.5352">tp_rgw_process_2</text><!--MD5=[ad7bd1117d3e7aeba10b79a5da4f0bee]
entity tp_rgw_process_n--><ellipse cx="473" cy="689" fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" rx="8" ry="8" style="stroke:#A80036;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="123" x="411.5" y="719.5352">tp_rgw_process_n</text><path d="M371.5,538.5 L371.5,559.0996 L664.5,559.0996 L664.5,548.5 L654.5,538.5 L371.5,538.5 " fill="#FBFB77" filter="url(#f1ohd75zkk3k4h)" style="stroke:#A80036;stroke-width:1.0;"/><path d="M654.5,538.5 L654.5,548.5 L664.5,548.5 L654.5,538.5 " fill="#FBFB77" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="9" lengthAdjust="spacing" textLength="272" x="377.5" y="552.2012">process num: rgw_thread_pool_size * rgw_thread_max_ops</text><!--MD5=[e47d1625a6d378d9e6c65601568ee3b8]
entity read_conn_bufer--><ellipse cx="82" cy="808" fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" rx="8" ry="8" style="stroke:#A80036;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="116" x="24" y="838.5352">read_conn_bufer</text><!--MD5=[aa7c85e174e17d78cb902b8c151f841d]
entity execute_rgw_req--><ellipse cx="82" cy="927" fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" rx="8" ry="8" style="stroke:#A80036;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="117" x="23.5" y="957.5352">execute_rgw_req</text><!--MD5=[6c9a0f62e87943f52c73fb9193d7e0fd]
entity http_response--><ellipse cx="82" cy="1046" fill="#FEFECE" filter="url(#f1ohd75zkk3k4h)" rx="8" ry="8" style="stroke:#A80036;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="98" x="33" y="1076.5352">http_response</text><!--MD5=[b2dd823b0f7d9d112e2eba74c0ab90e8]
link NginxProcess1 to TCP_UnixSocket1--><path d="M78.57,57.09 C79.19,81.01 80.16,118.35 80.66,137.96 " fill="none" id="NginxProcess1-to-TCP_UnixSocket1" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="80.79,143,84.5573,133.9002,80.6615,138.0017,76.56,134.1058,80.79,143" style="stroke:#A80036;stroke-width:1.0;"/><!--MD5=[838a2278599885a40afe1dcbf05f5ab5]
link NginxProcess2 to TCP_UnixSocket2--><path d="M255,57.09 C255,81.01 255,118.35 255,137.96 " fill="none" id="NginxProcess2-to-TCP_UnixSocket2" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="255,143,259,134,255,138,251,134,255,143" style="stroke:#A80036;stroke-width:1.0;"/><!--MD5=[5709f7b4ab674fdf73334cd818bcec1e]
link NginxProcessN to TCP_UnixSocketN--><path d="M433,57.09 C433,81.01 433,118.35 433,137.96 " fill="none" id="NginxProcessN-to-TCP_UnixSocketN" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="433,143,437,134,433,138,429,134,433,143" style="stroke:#A80036;stroke-width:1.0;"/><!--MD5=[a1b2b8e24c0993b134f6b8c29220354f]
link TCP_UnixSocket1 to fcgi--><path d="M90.35,159.83 C114.47,177.43 179.68,225.02 220.42,254.76 " fill="none" id="TCP_UnixSocket1-to-fcgi" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="224.78,257.94,219.8576,249.4094,220.7376,254.9974,215.1496,255.8774,224.78,257.94" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="37" x="185" y="224.5684">select</text><!--MD5=[49fb701806fc292133047d669fa420ec]
link TCP_UnixSocket2 to fcgi--><path d="M255,161.33 C255,179.52 255,223.44 255,252.45 " fill="none" id="TCP_UnixSocket2-to-fcgi" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="255,257.68,259,248.68,255,252.68,251,248.68,255,257.68" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="37" x="256" y="224.5684">select</text><!--MD5=[dd17070ec90e8adbeb5ba19eaa1bf31e]
link TCP_UnixSocketN to fcgi--><path d="M423.93,159.47 C399.68,176.77 332.37,224.8 290.4,254.74 " fill="none" id="TCP_UnixSocketN-to-fcgi" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="286.17,257.76,295.8212,255.7966,290.2425,254.8592,291.1799,249.2806,286.17,257.76" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="37" x="351" y="224.5684">select</text><!--MD5=[63ef4dcd30a308c2e636fda099cfcc51]
link fcgi to rgw_frontend_thread--><path d="M255,304.01 C255,327.74 255,365.55 255,391.29 " fill="none" id="fcgi-to-rgw_frontend_thread" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="255,396.59,259,387.59,255,391.59,251,387.59,255,396.59" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="9" lengthAdjust="spacing" textLength="169" x="321.5" y="343.7012">new FCGX_Request with socket conn.</text><text fill="#000000" font-family="sans-serif" font-size="9" lengthAdjust="spacing" textLength="297" x="256" y="354.3008">QueueRing size   &lt; rgw_thread_pool_size * rgw_thread_max_ops</text><text fill="#000000" font-family="sans-serif" font-size="9" lengthAdjust="spacing" textLength="215" x="297" y="364.9004">QueueRing not exits  slot, rgw will be overload</text><!--MD5=[7e9216f588fc72ba655a2861ea2fefae]
link rgw_frontend_thread to req_wq--><path d="M255,443.12 C255,469.59 255,513.05 255,534.77 " fill="none" id="rgw_frontend_thread-to-req_wq" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="255,539.8,259,530.8,255,534.8,251,530.8,255,539.8" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="167" x="256" y="486.5684">_enqueue UserQosRequest</text><!--MD5=[38e76a04846302b1aba8324824dc700a]
link req_wq to tp_rgw_process_1--><path d="M245.88,553.22 C225.85,560.59 177.19,580.24 144,608 C120.34,627.78 99.98,658.04 89.52,675.11 " fill="none" id="req_wq-to-tp_rgw_process_1" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="86.84,679.56,94.9143,673.9203,89.423,675.2788,88.0644,669.7875,86.84,679.56" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="8" lengthAdjust="spacing" textLength="95" x="148" y="616.7344">WorkerThread::_dequeue</text><text fill="#000000" font-family="sans-serif" font-size="8" lengthAdjust="spacing" textLength="92" x="148" y="626.7344">WorkerThread::_process</text><!--MD5=[8c888e9aaad4300c81690a125632319f]
link req_wq to tp_rgw_process_2--><path d="M254.44,558.25 C253.7,569.5 252.46,590.26 252,608 C251.4,631.26 252.87,658.32 253.96,674.25 " fill="none" id="req_wq-to-tp_rgw_process_2" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="254.33,679.59,257.6786,670.3279,253.9738,674.6027,249.6989,670.8979,254.33,679.59" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="8" lengthAdjust="spacing" textLength="95" x="256" y="616.7344">WorkerThread::_dequeue</text><text fill="#000000" font-family="sans-serif" font-size="8" lengthAdjust="spacing" textLength="92" x="256" y="626.7344">WorkerThread::_process</text><!--MD5=[82fdda9671476098d45efeffedcda20a]
link req_wq to tp_rgw_process_n--><path d="M264.06,554.88 C281.92,564.57 322.8,587.1 356,608 C370.61,617.19 373.76,620.25 388,630 C413.19,647.26 442.64,667.33 459.43,678.76 " fill="none" id="req_wq-to-tp_rgw_process_n" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="463.81,681.75,458.613,673.384,459.674,678.9404,454.1176,680.0015,463.81,681.75" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="8" lengthAdjust="spacing" textLength="95" x="392" y="616.7344">WorkerThread::_dequeue</text><text fill="#000000" font-family="sans-serif" font-size="8" lengthAdjust="spacing" textLength="92" x="392" y="626.7344">WorkerThread::_process</text><!--MD5=[9567f491b08afa575ead9a01fb05ece5]
link GMN11416 to tp_rgw_process_n--><path d="M515.69,559.71 C512.01,574.86 504.37,605 496,630 C489.95,648.08 481.35,668.71 476.56,679.84 " fill="none" id="GMN11416-tp_rgw_process_n" style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:7.0,7.0;"/><!--MD5=[1985fd4bf909b5c16b85efa38912d931]
link tp_rgw_process_1 to read_conn_bufer--><path d="M82,698.04 C82,717.91 82,769.48 82,793.86 " fill="none" id="tp_rgw_process_1-to-read_conn_bufer" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="82,798.9,86,789.9,82,793.9,78,789.9,82,798.9" style="stroke:#A80036;stroke-width:1.0;"/><!--MD5=[c421377d889b4e68a441cbe512b24ad8]
link read_conn_bufer to execute_rgw_req--><path d="M82,817.04 C82,836.91 82,888.48 82,912.86 " fill="none" id="read_conn_bufer-to-execute_rgw_req" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="82,917.9,86,908.9,82,912.9,78,908.9,82,917.9" style="stroke:#A80036;stroke-width:1.0;"/><!--MD5=[aea8cd8e3f92fa828be867cc58bd6e27]
link execute_rgw_req to http_response--><path d="M82,936.04 C82,955.91 82,1007.48 82,1031.86 " fill="none" id="execute_rgw_req-to-http_response" style="stroke:#A80036;stroke-width:1.0;"/><polygon fill="#A80036" points="82,1036.9,86,1027.9,82,1031.9,78,1027.9,82,1036.9" style="stroke:#A80036;stroke-width:1.0;"/><!--MD5=[75aa3759f23616148c8d9ac749efcebe]
@startuml
    [NginxProcess1] 
    [NginxProcess2]
    [NginxProcessN]
    [fcgi]
    [rgw_frontend_thread]
   NginxProcess1 - -> TCP_UnixSocket1
   NginxProcess2 - -> TCP_UnixSocket2
   NginxProcessN - -> TCP_UnixSocketN
   note top
    default:TCP
    could be UnixSocket
    concurrent decided to cosbench jobs
   end note
   TCP_UnixSocket1 - -> fcgi:select 
   TCP_UnixSocket2 - -> fcgi:select 
   TCP_UnixSocketN - -> fcgi:select 
   fcgi - -> rgw_frontend_thread:<font size=9> new FCGX_Request with socket conn.</font>\n<font size=9>QueueRing size   < rgw_thread_pool_size * rgw_thread_max_ops</font>\n<font size=9>QueueRing not exits  slot, rgw will be overload</font>
   rgw_frontend_thread - -> req_wq:_enqueue UserQosRequest
   req_wq - -> tp_rgw_process_1:<font size=8> WorkerThread::_dequeue</font>\n<font size=8>WorkerThread::_process</font>
   req_wq - -> tp_rgw_process_2:<font size=8> WorkerThread::_dequeue</font>\n<font size=8>WorkerThread::_process</font>
   req_wq - -> tp_rgw_process_n:<font size=8> WorkerThread::_dequeue</font>\n<font size=8>WorkerThread::_process</font>
note top
<font size=9>process num: rgw_thread_pool_size * rgw_thread_max_ops</font>
end note
tp_rgw_process_1 - -> read_conn_bufer 
read_conn_bufer - -> execute_rgw_req
execute_rgw_req - -> http_response
@enduml

PlantUML version 1.2021.12(Wed Oct 06 00:01:58 CST 2021)
(GPL source distribution)
Java Runtime: Java(TM) SE Runtime Environment
JVM: Java HotSpot(TM) 64-Bit Server VM
Default Encoding: UTF-8
Language: zh
Country: CN
--></g></svg></p>
      </div>
      
      
    
    
    
    
    
    
    
    
  
    </body></html>